﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using edu.Model;
using edu.Service;

namespace edu.ztest
{
    public partial class HomeworkTest : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            add();
        }

        private void add()
        {
            Homework entity = new Homework();
            entity.Name = "name";
            entity.Code = "code";
            entity.Description = "description";
            entity.TeacherId = 1;
            entity.Year = DateTime.Now.Year;
            entity.Month = DateTime.Now.Month;
            entity.Day = DateTime.Now.Day;
            int id = HomeworkService.Add(entity);
            Response.Write("<script>alert(" + id + ")</script>");
        }

        private void check()
        {
            HomeworkService.Check(22, 2011, 2, 4);
        }
    }
}